import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;

/**
 * the main class of the RMI server
 */
public class Main {
	/**
	 * start RMI server at localhost
	 */
	private final static String host = "localhost";

	public static void main(String args[]) {
		try {
			RMIServer serv = new RMIServer("output.txt");
			String rmiName = "rmi://" + host + "/myrmiServ";
			Naming.rebind(rmiName, serv);
			System.out.println("server ready");
		} catch (RemoteException e) {
			System.out.println("a problem occured, remote exception");
		} catch (MalformedURLException e) {
			System.out.println("malformed url");
		} catch (IOException e) {
		}
	}
}
